<%= render App::ShareFormComponent.new title: "Post to Mastodon", icon: "icon-share-mastodon" do %>
  <%= form_tag("", remote: true) do %>

    <div class="mb-4">
      <%= render Form::TextInputComponent.new do |text| %>
        <% text.label_content do %>
          <label for="mastodon_status">Status</label>
        <% end %>
        <% text.input do %>
          <%= text_area_tag :status, "", class: "combined-placeholder peer text-input", id: "mastodon_status", rows: 4 %>
        <% end %>
      <% end %>
    </div>

    <div class="mb-4">
      <%= render Form::TextInputComponent.new do |text| %>
        <% text.label_content do %>
          <label for="mastodon_spoiler_text">Content Warning</label>
        <% end %>
        <% text.input do %>
          <%= text_field_tag :spoiler_text, "", class:"peer text-input", placeholder: "optional", id: "mastodon_spoiler_text" %>
        <% end %>
      <% end %>
    </div>

    <div class="mb-4">
      <%= render Form::SelectInputComponent.new do |text| %>
        <% text.label_content do %>
          <label for="mastodon_visibility">Visibility</label>
        <% end %>
        <% text.input do %>
          <%= select_tag "visibility", options_for_select({"Public" => "public", "Unlisted" => "unlisted", "Followers only" => "private", "Mentioned people only" => "direct"}), class: "peer", id: "mastodon_visibility" %>
        <% end %>
      <% end %>
    </div>

    <%= render Settings::ButtonRowComponent.new do %>
      <%= button_tag "Cancel", type: "button", class: "button button-secondary", data: {behavior: "close_entry_basement"} %>
      <%= button_tag "Post", type: "submit", class: "button" %>
    <% end %>

  <% end %>
<% end %>
